package com.leadingsoft.pwxk.converter;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import com.leadingsoft.common.converter.AbstractConverter;
import com.leadingsoft.pwxk.dto.AirQcPollutionDto;
import com.leadingsoft.pwxk.model.AirQcPollution;

@Component
public class AirQcPollutionConverter extends AbstractConverter<AirQcPollution, AirQcPollutionDto> {

	@Override
	protected AirQcPollutionDto toDtoActual(AirQcPollution model) {
		AirQcPollutionDto dto = new AirQcPollutionDto();
		BeanUtils.copyProperties(model, dto);
		return dto;
	}

	@Override
	public void copyProperties(AirQcPollution model, AirQcPollutionDto dto) {

	}

	public List<AirQcPollutionDto> toListDto(List<AirQcPollution> list) {
		List<AirQcPollutionDto> dtos = new ArrayList<AirQcPollutionDto>();
		list.forEach(t -> {
			dtos.add(toDtoActual(t));
		});
		return dtos;
	}

}
